//渲染普通表头
function renderCommonHead(thElem, col) {
    thElem.className = 'et-common-th';
    thElem.innerText = col.title;
}

//渲染普通网格
function renderCommonBody(tdElem, col, rawData) {
    let divElem = document.createElement('div');
    divElem.innerText = rawData[col.field];
    tdElem.appendChild(divElem);
    //渲染可编辑
    editable(divElem, col, rawData);
}

//控件编辑
function editable(divElem, col, rawData) {
    if (col.editable) {//可编辑
        divElem.contentEditable = "true";
        divElem.onblur = () => {
            rawData[col.field] = divElem.innerText;
        }
    } else {//不可编辑

    }
}


//控件校验
//绑定焦点移入移除事件



export { renderCommonHead, renderCommonBody };